package com.otaku.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.validation.Validator;
import org.springframework.validation.beanvalidation.LocalValidatorFactoryBean;
import org.springframework.validation.beanvalidation.MethodValidationPostProcessor;


/**
 * 作者：ganxiang <br>
 * 时间：2018年04月20日 11:03<br>
 * 标题：ValidatorConfig<br>
 * 功能：验证工具<br>
 */
@Configuration
public class ValidatorConfig {

    @Bean
    public Validator validator(){
        return new LocalValidatorFactoryBean();
    }

    @Bean
    public MethodValidationPostProcessor methodValidationPostProcessor() {
        return new MethodValidationPostProcessor();
    }
}
